<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML> 
<html>
	<head>
		<base href="<%=basePath%>">

		<title>影城管理</title>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>css/bootstrap.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>css/theme.css"> 
		<script src="<%=basePath%>jquery/jquery.min.js"
			type="text/javascript"></script>
		<script src="<%=basePath%>layer-v2.4/layer/layer.js"
			type="text/javascript"></script>	
		<script src="/jquery/my.js" type="text/javascript"></script>	
        <style type="text/css">
           td.td{
             height:90px;
             line-height: 90px;
           }
           td.td1{
             width:100px;
             margin:3px;
             margin-top:5px;
             padding:3px;
           }
           td.td1 form{
             margin-bottom:0;
           }
        </style>
	</head>

	<body class="content1">
		<div class="header">
			<h1 class="page-title">
				影城管理
			</h1>
		</div>
		<ul class="breadcrumb">
			<li>
				<a href="index.jsp">Home</a>
				<span class="divider">/</span>
			</li>
			<li class="active">
				影城列表
			</li>
		</ul>
		<div class="container-fluid">
			<div class="row-fluid">
				<form class="form-inline" 
					action="<%=basePath%>cinema/list">
					<input class="input-xlarge" placeholder="...影城名称..." name="cinemaname"
						type="text">
					<input class="btn icon-search" type="submit" value="查询" />
					<a class="btn btn-primary"
						href="<%=basePath%>cinema/add"> <i
						class="icon-plus"></i> 新增影城 </a>
				</form>

				<div class="well">
					<table class="table">
						<thead>
							<tr>
								<th>
									影城名
								</th>
								<th>
									影城地址
								</th>
								<th>
									影城状态
								</th>
								<th style="width: 90px;">
									编辑
								</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${pager.list}" var="item">
								<tr>
									<td class="td">
										${item.fcName}
									</td>
									<td class="td">
										${item.fcAddress}
									</td>
									<td class="td">
										<c:choose>
											<c:when test="${item.fcState==1}">
												正常		
											</c:when>
											<c:otherwise>锁定</c:otherwise>
										</c:choose>
									</td>
									<td class="td1">
										<a href="<%=basePath%>cinema/detail/${item.fcId}" class="btn btn-suceess">修改</a>
										<form  class="im_tijiao" action="<%=basePath%>cinema/delete/${item.fcId}" method="post">
									         <input type="hidden" name="_method" value="DELETE">
									         <input type="button"  value="删除" class="dianji btn btn-danger">
									     </form>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="pagination pagination-right">
						<ul>
							<li>
								<a>共计：${pager.pagectrl.pagecount}页/${pager.pagectrl.rscount}条记录</a>
							</li>

							<li>
								<c:if test="${pager.pagectrl.currentindex==1}" var="fp">
									<a style="disabled: true">上一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a
										href="<%=basePath%>cinema/list?cinemaname=${param.cinemaname}&current=${pager.pagectrl.currentindex-1}">上一页</a>
								</c:if>
							</li>

							<c:forEach begin="${pager.pagectrl.minpage}" step="1"
								end="${pager.pagectrl.maxpage}" var="index">
								<li>
									<c:if test="${pager.pagectrl.currentindex==index}" var="t">
										<a style="color: red; background-color: #bbb">${index}</a>
									</c:if>
									<c:if test="${!t}">
										<a href="<%=basePath%>cinema/list?cinemaname=${param.cinemaname}&current=${index}">${index}</a>
									</c:if>
								</li>
							</c:forEach>

							<li>
								<c:if
									test="${pager.pagectrl.currentindex==pager.pagectrl.pagecount}"
									var="fp">
									<a style="disabled: true">下一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a
										href="<%=basePath%>cinema/list?cinemaname=${param.cinemaname}&current=${pager.pagectrl.currentindex+1}">下一页</a>
								</c:if>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
